-content_for :modal_title do
  -if f.object.new_record?
    Create a new reference
  -else
    Edit reference

-if !f.object.new_record? && params[:no_delete].nil?
  -content_for :modal_delete_path, delete_flow_document_path(f.object)

.row-fluid
  .span4
    .span12{ :class => error_class(f, :title) }
      =f.label :title, "Title".html_safe
      =f.text_field :title, :class => 'span12', :placeholder => 'Enter the title of this reference'
      =error_messages_inline(f, :title)

  =wrapped_select(f, :span2, :year_id, Option.options_for(:document_year).ordered_by_title_desc.map { |o| [o.title, o.id] }, :selected => (f.object.respond_to?(:year_id) ? f.object.year_id : nil), :include_blank => true)
  =wrapped_select(f, :span2, :language_id, Option.options_for(:language).map { |o| [o.title, o.id] }, :selected => (f.object.respond_to?(:language_id) ? f.object.language_id : nil), :include_blank => true)
  =wrapped_select(f, :span2, :kind_id, Option.options_for(:reference_type).map { |o| [o.title, o.id] }, :selected => (f.object.respond_to?(:kind_id) ? f.object.kind_id : nil), :include_blank => true, :label_name => 'Reference Kind')
  =wrapped_select(f, :span2, :type_id, Option.options_for(:document_type).map { |o| [o.title, o.id] }, :selected => (f.object.respond_to?(:type_id) ? f.object.type_id : nil), :include_blank => true, :label_name => 'DocType')

%br

.row-fluid
  =wrapped_text_area f, :span12, :description, :class => 'double wysihtml5', :wrapper_div_class => 'wysiwyg-area', :placeholder => 'Enter description here'

.row-fluid
  .span12{ :class => error_class(f, :link) }
    =f.label :link, "URL <span class='required'>*</span>".html_safe
    =f.text_field :link, :class => 'span12', :placeholder => 'https://www.example.com/xyz.pdf'
    =error_messages_inline(f, :link)

%br

=render :partial => "shared/wysihtml5"
